#!/usr/bin/env python
# -*- coding: utf-8 -*-
# title       :
# author      : jarry

import sys
import os
import logging
from SceneCheckTool.checkScript.CheckBase import CheckBase
try:
    import maya.cmds as cmds
    import pymel.core as pm
    import JTK.jmaya.core as jmc

except:
    pass

logging.basicConfig()
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)


class AssignLambertMesh(CheckBase):
    def __init__(self):
        super(AssignLambertMesh, self).__init__()
        pass

    def lambert_assign_mesh(self):
        lambert_mesh = pm.sets('initialShadingGroup', q=1)
        lambert_mesh_error = []
        for lm in lambert_mesh:
            pass
            try:
                if '_render_grp' in lm.longName():
                    lambert_mesh_error.append(lm.name())
            except:
                pass
        return lambert_mesh_error

    def check(self):

        result_proc = self.lambert_assign_mesh()
        if result_proc:
            result_log = u'Error:%s\n' % result_proc
        else:
            result_log = u'Succeed:没有问题\n'

        return result_log

    def fix(self):
        pass

